#include "model/md5.h"

namespace sheeplib {

	namespace model {

		MD5::MD5() {

		}

		MD5::~MD5() {

		}

		bool MD5::LoadModelFile(const string& filename) {

			ifstream fileIn(filename.c_str());

			if (!fileIn.is_open()) {
				//FIXME: Record error
				return false;
			}


			//ReadVersionNumber();
			//ReadCommandLine();
			//ReadJointAndMeshCounts();

			string line;

			while(getline(fileIn, line)) {
				if (line.find("joints") != string::npos) {
					ReadJointList(fileIn);
				}

				if (line.find("mesh")) {
					ReadMesh(fileIn);
				}
			}



			return true;
		}
	}

}
